<?php
$id_fiche = $_GET["id_fiche"];
    $sqlm="select * from infos_gen where id_fiche=$id_fiche";
    $resm = mysql_query($sqlm);
    $rm = @mysql_fetch_object($resm);
    
?>
<fieldset>
    <legend><?php echo TXT_INFO_GEN;?></legend>
    <table>
        <tr>
            <td> <?php echo TXT_NOM_PROD;?></td>
            <td><input type="text" name="nom_prod" value="<?php echo"$rm->nom";?>"></td>
        </tr>
       <tr>
                            <td> <?php echo TXT_PRENOM_PROD; ?></td>
                            <td><input type="text" name="prenom_prod" value="<?php echo"$rm->prenom";?>"></td>
                        </tr>
        
        <tr>
            <td> <?php echo TXT_SEXE;?></td>
            <td><select name="sexe">
                    <option value="0"></option>
                    <option value="Homme" <?php if($rm->sexe=="Homme") echo"selected";?>><?php echo TXT_HOMME;?></option>
                    <option value="Femme" <?php if($rm->sexe=="Femme") echo"selected";?>><?php echo TXT_FEMME;?></option>
                </select></td>
        </tr>
        <tr>
            <td> <?php echo TXT_NOM_MEDIA;?></td>
            <td>
                <select name="media">
                    <option value="0"></option>
                    <?php $sql="select * from type_medias order by descr";
                    $res = mysql_query($sql);
                    while($r = mysql_fetch_object($res)){
                    ?>
  <optgroup label="<?php echo "$r->descr";?>">
    <?php 
    $sql1="select * from medias where type=$r->id order by descr";
    $res1 = mysql_query($sql1);
    while($r1 = mysql_fetch_object($res1)){
    ?>
      <option value="<?php echo"$r1->id";?>" <?php if($rm->nom_media==$r1->id) echo"selected";?>><?php echo"$r1->descr";?></option>
  <?php }?>
  </optgroup>
  <?php }?>
</select>
               </td>
        </tr>
      
        <tr>
            <td> <?php echo TXT_PAYS;?></td>
            <td>
                <select name="pays">
                    <option value="0"></option>
                    <?php 
                    $sql2="select * from pays";
                    $res2 = mysql_query($sql2);
                    while ($r2 = mysql_fetch_object($res2)){
                    ?>
                    <option value="<?php echo "$r2->id";?>" <?php if($rm->pays==$r2->id) echo"selected";?>><?php echo $r2->pays?></option>
                    <?php }?>
                </select>
                </td>
        </tr>
        <tr>
            <td> <?php echo TXT_LOCALITE;?></td>
            <td><input type="text" name="localite" value="<?php echo"$rm->localite";?>"></td>
        </tr>
    </table>
    
</fieldset>